<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 静态下拉菜单 -->
    <select id="staticSelect">
        <option value="apple">苹果</option>
        <option value="banana">香蕉</option>
        <option value="orange">橙子</option>
    </select>
    <!-- 动态下拉菜单 -->
    <select id="dynamicSelect"></select>
    <input type="checkbox" name="" id="" >
    <button>点击</button>
    <select name="" id=""></select>
    <script>
        const dynamicSelect = document.getElementById('dynamicSelect');
        const fruits = ['草莓', '葡萄', '西瓜'];

        fruits.forEach(fruit => {
            const option = document.createElement('option');
            option.value = fruit.toLowerCase();
            option.textContent = fruit;
            dynamicSelect.appendChild(option);
        });

        // 获取选中的值
        dynamicSelect.addEventListener('change', function() {
            console.log('你选择了: ' + this.value);
        });
    </script>
</body>
</html>